/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package questao14;

/**
 *
 * @author SDKW
 */
public class Operador extends ItemCalculadora {

    public Operador(String operacao) {
        super(operacao);
    }

    @Override
    protected String getOperacao() {
        try {
            if (!this.operacao.equals("+")
                    && !this.operacao.equals("-")
                    && !this.operacao.equals("*")
                    && !this.operacao.equals("/")) {
                throw new Exception("Operadores Validos + , - , * , / .");
            } else {
                return this.operacao;
            }
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return null;
        }
        
    }
}
